import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/login')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "about" */ '../views/home')
  },
  {
    path: '/role',
    name: 'role',
    component: () => import(/* webpackChunkName: "about" */ '../views/role')
  },
  {
    path: '/study',
    name: 'study',
    component: () => import(/* webpackChunkName: "about" */ '../views/study')
  },
  {
    path: '/caseStudy',
    name: 'caseStudy',
    component: () => import('../views/caseStudy')
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('../views/test')
  },
  {
    path: '/threeD',
    name: 'threeD',
    component: () => import('../views/threeD')
  },
  {
    path: '/roleintro',
    name: 'roleintro',
    component: () => import('../views/roleintro')
  },
  {
    path: '/inquiry',
    name: 'inquiry',
    component: () => import('../views/inquiry')
  },
  {
    path: '/backlogin',
    name: 'login',
    component: () => import('../views/back/login')
  },
  {
    path: '/backhome',
    name: 'home',
    component: () => import('../views/back/home'),
    children: [
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/back/user')
      },
      {
        path: '/backCaseStudy',
        name: 'backCaseStudy',
        component: () => import('../views/back/backCaseStudy')
      },
      {
        path: '/ques',
        name: 'ques',
        component: () => import('../views/back/ques')
      },
      {
        path: '/paper',
        name: 'paper',
        component: () => import('../views/back/paper')
      },
      {
        path: '/dataManage',
        name: 'dataManage',
        component: () => import('../views/back/dataManage')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
